package com.imy.luascript.app.data.general;

import java.io.File;

public class ProjectItem implements Comparable<ProjectItem>{
  public  static final int TYPE_FILE=1;
  public static final int TYPE_BACK=2;
  public File file;
  public File getFile() {
    return file;
  }
  public int type;

  public int getType() {
    return type;
  }

  public void setType(int type) {
    this.type = type;
  }

  @Override
  public int compareTo(ProjectItem o) {
    if (o.type==TYPE_BACK){
      return 1;
    }
    File file = o.getFile();
    if (file==null){
      return 0;
    }
    if (file.getName().equals("res")){
      return 1;
    }
    long l = file.lastModified();
    long l1 = this.file.lastModified();
    if (l1>l){
      return -1;
    }
    return 1;
  }
}
